package com.zheng.study.base.bean.search.projection;

import com.zheng.study.base.bean.search.SearchEnum;
import org.springframework.util.Assert;

/**
 * 查询 - 参数 - ProjectionRowCount
 * ============================================================================
 * author : fallenpanda
 * createDate:  2018/6/11 。
 * ============================================================================
 */
public class ProjectionRowCount extends Projection {

	private ProjectionRowCount(SearchEnum.ProjectionType projectionType) {
		super(projectionType);
	}

	public static ProjectionRowCount rowCount(){
		return newBuilder().setProjectionType(SearchEnum.ProjectionType.rowCount).build();
	}

	public static Builder newBuilder(){
		return new Builder();
	}

	public static class Builder extends Projection.Builder<Projection, Builder>{

		@Override
		protected Builder getThis() {
			return this;
		}

		@Override
		public ProjectionRowCount build() {
			Assert.notNull(projectionType, "projectionType 不能为空");
			return new ProjectionRowCount(projectionType);
		}
	}

}
